#@adminLayout()
#define main()
<div class="jbolt_page" data-key="#(pmkey)">
    <div class="jbolt_page_title">
        <div class="row">
            <div class="col-2">
                <h1>营销管理</h1>
                <span> #(pageData.totalRow?? 0) 条记录</span>
            </div>
            <div class="col-7" >
                <form class="form-inline"  id="marketRetailer" action="/auth/mall/market"  data-pjaxsubmit  method="get">
                    <select class="form-control"
                            name="retailerId"
                            id="retailerId"
                            data-autoload
                            data-url="/auth/mall/retailer/options"
                            data-text="请选择商家"
                            data-value=""
                            data-select="#(retailerId??)"
                    >
                    </select >
                  <input type="text" autocomplete="off"  class="form-control"  placeholder="输入关键字搜索" id="keywords" name="keywords" value="#(keywords??)" />
                    <button  type="submit" class="btn btn-light" ><i class="fa fa-search"></i> 查询</button>
                    <button    onclick="Testreset()" data-handler="reloadCurrentPage" class="btn btn-light" ><i class="fa fa-refresh"></i> 重置</button>
                </form>
            </div>
            <div class="col-3">
                <button data-area="800,500" data-handler="refreshPjaxContainer"   data-jboltlayertrigger  data-width="500" data-noclose  data-confirm   data-title="新增" data-url="/auth/mall/market/add_market" class="pull-right jbolt_table_addbtn btn btn-success" ><i class="fa fa-plus"></i> 新增</button>
            </div>


        </div>
    </div>
    <div class="jbolt_page_content">
        <div class="table-responsive">
            <table class="table table-bordered table-hover table-striped table-center">
                <thead>
                <tr>
                    <th style="width: 60px">序号</th>
                    <th style="width:200px">名称</th>
                    <th style="width: 200px">商家名称</th>
                    <th style="width: 300px">商品类型名称</th>
                    <th style="min-width:250px">摘要</th>
                    <th style="width:100px;">平台抽成比(%)</th>
                    <th style="width:100px;">分销商积分比(%)</th>
                    <th style="width:100px;">折扣比(%)</th>
                    <th style="width: 200px">是否有效</th>
                    <th  style="width:100px">操作</th>

                </tr>
                </thead>
                <tbody>
                #if(pageData)
                #for(data:pageData.list)
                <tr>
                    <td>#(for.index+1??)</td>
                    <td>#(data.name??)</td>
                    <td>#(data.retailer_name??)</td>
                    <td>#(data.commodity_type_name??)</td>
                    <td>#(data.brief??)</td>
                    <td>#(data.platform_commission??)</td>
                    <td>#(data.spreader_credit??)</td>
                    <td>#(data.discount??)</td>
                    <td><img src="#(data.status==2?'/assets/img/switch/default/on.png':'/assets/img/switch/default/off.png')" data-switchbtn data-confirm="是否切换营销状态?"   data-url="/auth/mall/market/toggle_market_status/#(data.id)"/></td>
                    <td>
                        <a  tooltip  title="编辑"  class="jbolt_table_delbtn" data-confirm  data-jboltlayertrigger  href="/auth/mall/market/modify_market/#(data.id)" class="btn btn-info"   data-width="500"  data-noclose><i class="fa fa-pencil c-primary"></i></a>
                        <a  tooltip  title="删除"  href="/auth/mall/market/delete_market_retailer/#(data.id)" data-handler="refreshPjaxContainer"  data-confirm="确定删除该条营销信息?" class="jbolt_table_delbtn"> <i class="fa fa-remove c-danger"></i> </a>
                    </td>
                </tr>
                #end
                #end
                </tbody>
            </table>
        </div>
        #include("/_view/_admin/common/_page.html",pageEleId="marketRetailerPage")
    </div>
</div>
#end
#define js()
<script>

    $(function(){
        initPage("marketRetailerPage",#(pageData.totalPage??),#(pageData.pageNumber??),"marketRetailer");
    });


    function Testreset() {
        document.getElementById("retailerId").value = "";
        document.getElementById("keywords").value = "";

    }


    //测试可刷新 -- 提交表单
    function RefreshsubmitForm(formEId){
        var form=getRealJqueryObject(formEId);
        if(FormChecker.check(form)){
            var url=form.action;
            form.ajaxSubmit({
                type:"post",
                url:url,
                success:function(ret){
                    if(ret.state=="ok"){
                        LayerMsgBox.success(ret.msg,500,function(){
                            refreshPjaxContainer();
                        });
                    }else{
                        LayerMsgBox.alert(ret.msg,2);
                    }
                }
            });
        }
        return false;
    }


</script>
#end

